﻿namespace com.vs.General
{
    using com.vs.DataAccess.DO;
    using System;

    public class HistoryManager
    {
        public static void SaveProcessHistory(Session sess, string stProcess, string stCondition, string stMessage)
        {
            SaveProcessHistory(sess, stProcess, stCondition, stMessage, null, null, null, null);
        }

        public static void SaveProcessHistory(Session sess, string stProcess, string stCondition, string stMessage, string stIdentifier1, string stIdentifier2, string stIdentifier3, string stIdentifier4)
        {
            try
            {
                try
                {
                    new ProcessHistoryDO { CONDITION = stCondition, DATE_TIME_STAMP = DateTime.Now, IDENTIFIER1 = stIdentifier1, IDENTIFIER2 = stIdentifier2, IDENTIFIER3 = stIdentifier3, IDENTIFIER4 = stIdentifier4, MESSAGE = stMessage, PROCESS_TYPE = stProcess, USER_STAMP = sess.User, WAREHOUSE = sess.CurrentWarehouse }.Insert(sess);
                }
                catch (Exception exception)
                {
                    ExceptionManager.LogException(sess, exception);
                }
            }
            finally
            {
            }
        }

        public class Condition
        {
            public static string iDelete = "删除";
            public static string iError = "错误";
            public static string iFailed = "失败";
            public static string iInfo = "信息";
            public static string iNew = "新建";
            public static string iRejected = "拒绝";
            public static string iSucceed = "成功";
        }

        public class ProcessType
        {
            public static string iAllocate = "库存分配";
            public static string iAllocationRuleAssign = "动态设定分配规则";
            public static string iCancelAllocate = "取消分配";
            public static string iCancelCheckIn = "取消收货";
            public static string iCheckIn = "收货";
            public static string iInventory = "库存";
            public static string iItem = "货品";
            public static string iLocate = "定位";
            public static string iLocatingRuleAssign = "动态设定定位规则";
            public static string iLocation = "库位";
            public static string iPacking = "包装";
            public static string iPickAndPutaway = "执行任务";
            public static string iPicking = "拣货";
            public static string iPutaway = "上架";
            public static string iReceipt = "入库单";
            public static string iReplenishment = "补货";
            public static string iShipment = "出库单";
            public static string iTask = "任务";
            public static string iTechnical = "系统异常";
            public static string iUnlocate = "取消定位";
            public static string iWave = "波次";
        }
    }
}

